{extend name="public:base"/}
{block name="style"}

{/block}
{block name="main"}
  
  <form action="{:Url('admin/roleinfo')}" method="POST"> 
    <input type="hidden" name="id" value="{:input('id')}">
    <div class="form-group">
      <label  class="col-sm-2 control-label">角色名称:</label>

      <div class="col-sm-10">
        <input type="text" name="name" class="form-control"  placeholder="角色名称" value="{$info['name']}">
      </div>
    </div>
    <hr>
    {volist name="rulelist" id="vo" key="k" }
    <h4><b>{$vo['name']}</b></h4>
    <div class="row">
        {volist name="vo['rule']" id="v" }
          <div class="col-xs-3 col-sm-6">
            <div class="input-group">
     
             
                  <input type="checkbox" name="rule[]" value="{$v['id']}" 
                  <?php 
                    if(isset($v['id'])&&isset($info['rule'])){
                      if(in_array($v['id'],$info['rule'])){
                        echo "checked='checked'";
                      }
                    }
                    
                  ?>
                  }>  {$v['name']}
            
            </div>
          </div>
        {/volist}
    </div> 
    {/volist}         
    <p>
      <button class="btn btn-success pull-right" type="submit" id="oks">确定</button>
    </p>
  </form>
{/block}